<%@page import="com.balloon.logic.*,java.util.*;"%>


<html>
    <head>
        <title>IBallon Personal Page</title>
        <link type="text/css" href="css/jquery.ui.all.css" rel="stylesheet" />
        <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
        <script type="text/javascript" src="js/jquery.ui.core.js"></script>
        <script type="text/javascript" src="js/jquery.ui.widget.js"></script>
        <script type="text/javascript" src="js/jquery.ui.tabs.js"></script>
        <script type="text/javascript" src="js/validate.js"></script>
        <link type="text/css" href="css/demos.css" rel="stylesheet" />
        <script type="text/javascript">
            $(function() {
                $("#tabs").tabs();
                $("#profileform").validate({
                    rules: {
                        newpwd: "required",
                        renewpwd: {
                            equalTo: "#newpwd"
                        }
                    }
                });
            });
            function send(){
                document.vendor.action="Vendor.do";
                document.vendor.submit();
            }
        </script>
    </head>
    <body>
        <%! UserBean current;%>
        Welcome <%
                    current = (UserBean) session.getAttribute("currentuser");
                    out.println(current.getEmailAddress());
        %>
        <a href="MainPage.jsp?useremail=<%=current.getEmailAddress()%>" >Back to main page</a>
        <div class="demo">
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">My Footprint</a></li>
                    <li><a href="#tabs-2">My Focus</a></li>
                    <li><a href="#tabs-3">My Comments</a></li>
                    <li><a href="#tabs-4">My Photos</a></li>
                    <li><a href="#tabs-5">My Profile</a></li>
                    <li><a href="#tabs-6">Apply for Balloon</a></li>
                </ul>
                <div id="tabs-1">
                    <h3>Visited Places</h3>
                    <table>
                        <tr>
                            <td>City Name</td>
                            <td>Comments</td>
                        </tr>
                        <% ArrayList<UserVisitedPlace> temp = current.getVisitedPlaces();

                                    for (int i = 0; i < temp.size(); i++) {
                                        out.println("<tr>");
                                        out.println("<td>");
                                        out.println(temp.get(i).getObject());
                                        out.println("</td>");
                                        out.println("<td>");
                                        out.println(temp.get(i).getTime());
                                        out.println("</td>");
                                        out.println("</tr>");
                                    }

                        %>
                    </table>
                </div>
                <div id="tabs-2">
                    <p></p>
                </div>
                <div id="tabs-3">
                    <h3>City</h3>
                    <table>
                        <tr>
                            <td>City Name</td>
                            <td>Comments</td>
                        </tr>
                        <% ArrayList<UserComments> temp2 = current.getComments();

                                    for (int i = 0; i < temp2.size(); i++) {
                                        out.println("<tr>");
                                        out.println("<td>");
                                        out.println(temp2.get(i).getObject());
                                        out.println("</td>");
                                        out.println("<td>");
                                        out.println(temp2.get(i).getDescription());
                                        out.println("</td>");
                                        out.println("</tr>");
                                    }

                        %>


                    </table>
                </div>
                <div id="tabs-4">
                    <p></p>
                </div>
                <div id="tabs-5">
                    <form id="profileform" name="modify" action="">
                        <table>
                            <tr>
                                <td>User Name:</td>
                                <td><input name="name" type="text" disabled="true" value="<%=((UserBean) session.getAttribute("currentuser")).getEmailAddress()%> "/></td>
                            </tr>
                            <tr>
                                <td>Phone:</td>
                                <td><input name="phone" type="text" /></td>
                            </tr>
                            <tr>
                                <td>Now Password:</td>
                                <td><input name="oldpwd" type="password" /></td>
                            </tr>
                            <tr>
                                <td>New Password:</td>
                                <td><input name="newpwd" type="password" /></td>
                            </tr>
                            <tr>
                                <td>Confirm Password:</td>
                                <td><input name="renewpwd" name="renewpwd" type="password" /></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><input type="submit" value="submit" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
                <div id="tabs-6">
                    <form id="vendor" name="vendor" method="post" action="Vendor.do">
                        <table>
                            <tr>
                                <td>User Name:</td>
                                <td><input name="vendorName" type="text" /></td>
                            </tr>
                            <tr>
                                <td>Balloon Name:</td>
                                <td><input name="balloonName" type="text" /></td>
                            </tr>
                            <tr>
                                <td>Email Address:</td>
                                <td><input name="emailAddress"/></td>
                            </tr>
                            <tr>
                                <td>Balloon Type:</td>
                                <td>
                                    <select name="type">
                                        <option value="hotel">Hotel</option>
                                        <option value="restaurant">restaurant</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>City:</td>
                                <td><input name="city"/></td>
                            </tr>
                            <tr>
                                <td>Address Longitude:</td>
                                <td><input name="longitude"/></td>
                            </tr>
                            <tr>
                                <td>Address Latitude:</td>
                                <td><input name="latitude"/></td>
                            </tr>
                            <tr>
                                <td>Phone</td>
                                <td><input name="vendorPhone"/></td>
                            </tr>
                            <tr>
                                <td>Offical website</td>
                                <td><input name="website" /></td>
                            </tr>
                            <tr>
                                <td>Description</td>
                                <td><textarea name="description"></textarea></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><input type="submit" value="submit" /></td>
                            </tr>
                        </table>
                    </form>
                </div>


            </div>

        </div><!-- End demo -->

        <div class="demo-description">



        </div><!-- End demo-description -->

    </body>
</html>